package em;

import java.util.ArrayList;

import document.Document;

public class EMalgorithm {

	// TODO CALCULATE p(x_i), p(w_k | x_i)
	// TODO CONSIDER GETTING NUMBER OF WORDS

	private Parameters params; // parameters (theta) 
	
	public EMalgorithm(Parameters params) {
		this.params = params;
	}
	
	// TODO NUMBER OF TOPICS IS MainApp.NUM_TOPICS
	public void runEM(ArrayList<Document> documents, Logger logger) {

		// initialize algorithm
		initIter();
		
		// run EM algorithm until done
		while (!isDone()) {
			
			// run expectation step
			expectationStep();
			
			// run maximization step
			maximizationStep();
		}
	}
	
	private void initIter() {
		// TODO
	}
	
	private void expectationStep() {
		// TODO
	}
	
	private void maximizationStep() {
		// TODO
	}
	
	private boolean isDone() {
		return true; // TODO
	}
}
